package com.order.web;

import java.io.IOException;
import java.util.List;

import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.order.dao.AduserQuery;
import com.order.dao.bean.Aduser;

@WebServlet("/Ad_addConstraintServlet")
public class Ad_addConstraintServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    public Ad_addConstraintServlet() {
        super();
    }

	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		doPost(request,response);
	}

	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		response.setContentType("text/html;charset=gbk");
    	request.setCharacterEncoding("gbk");
    	List<Aduser> aduserList = AduserQuery.queryAll();
    	if(aduserList!=null){
    		request.setAttribute("aduserList", aduserList);
    		RequestDispatcher rd=request.getRequestDispatcher("/addAd.jsp");
    		rd.forward(request,response);
    	}
	}

}
